/**!
 * Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2024)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

syntax = "proto3";

option java_package = "com.snowflake.apps.streamlit";
option java_outer_classname = "PlotlyChartProto";

message PlotlyChart {
  oneof chart {
    // If the user chose to send the plot to Plotly's server, then this is the
    // URL that can be used to embed to the plot.
    string url = 1;

    // If the user chose to not send the plot to Plotly's server, then we pass
    // here the plot's dict spec as JSON.
    Figure figure = 2;
  }

  // If True, will overwrite the chart width spec to fit to container.
  bool use_container_width = 5;

  // override the properties with a theme. Currently, only "streamlit" or None are accepted.
  string theme = 6;

  reserved 3, 4;
}

message Figure {
  // JSON-serialized dict containing keys from the set {data, frames, layout}.
  string spec = 1;

  // JSON-serialized dict with Plotly's config object.
  string config = 2;
}
